package com.example.forum.exception;

import com.example.forum.common.AppResult;

/**
 * Created with IntelliJ IDEA.
 * Description: 自定义异常
 * User: DELL
 * Date: 2023-09-16
 * Time: 13:28
 */
public class ApplicationException extends RuntimeException {
    protected AppResult errorResult;

    public ApplicationException(AppResult errorResult) {
        super(errorResult.getMessage());
        this.errorResult = errorResult;
    }

    public ApplicationException(String message) {
        super(message);
    }

    public ApplicationException(String message, Throwable cause) {
        super(message, cause);
    }

    public ApplicationException(Throwable cause) {
        super(cause);
    }

    public AppResult getErrorResult() {
        return errorResult;
    }
}
